//
//  ZBTableCell.m
//  MoBan
//
//  Created by apple on 16/7/8.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ZBTableCell.h"
@interface ZBTableCell()
@property(nonatomic,strong)UIImageView *iconImageview;
@property(nonatomic,strong)UILabel *namelable;
@property(nonatomic,strong)UILabel *disstancelable;
@property(nonatomic,strong)UILabel *detailLable;
@end
@implementation ZBTableCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self addUI];
        
    }
    return self;
    
}
/**
 
 添加控件
 */
-(void)addUI
{
    self.iconImageview = [[UIImageView alloc]init];
    [self.contentView addSubview:self.iconImageview];
    
    self.namelable = [[UILabel alloc]init];
    [self.contentView addSubview:self.namelable];
    
    self.disstancelable = [[UILabel alloc]init];
    [self.contentView addSubview:self.disstancelable];
    
    self.detailLable = [[UILabel alloc]init];
    [self.contentView addSubview:self.detailLable];
}
/**
 设置fram
 */
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.iconImageview.frame = CGRectMake(10*Kscr, 10*Kscr, 60*Kscr, 60*Kscr);
    self.namelable.frame = CGRectMake(self.iconImageview.right+5*Kscr, 5*Kscr, 260*Kscr, 20*Kscr);
    self.detailLable.frame = CGRectMake(self.iconImageview.right+5*Kscr, self.namelable.bottom+5*Kscr, 300*Kscr, 60*Kscr);
    self.disstancelable.frame = CGRectMake(KscrW-40*Kscr, 5*Kscr, 40*Kscr, 20*Kscr);
    
}
-(void)ZBSetDatasouceWithModel:(NSString *)str
{
    self.iconImageview.image = [UIImage imageNamed:@"text.png"];
    self.namelable.text = @"测试";
    self.detailLable.text = @"测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试";
    self.disstancelable.text = @"2016-1-1";
    
//    self.namelable.text = str;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
